/*
 *   Copyright (c) 2010-2022, SIUFUNG
 */
package net.siufung.market.base.log.operate.controller.model.vo;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import net.siufung.core.model.AbstractVo;

import java.time.LocalDateTime;

/**
 * @author 陈建峰
 * @since 2022-07-04 17:54:53
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="OperateLogVo", description="系统日志表")
public class OperateLogVo extends AbstractVo {

    private static final long serialVersionUID = 560425185842579343L;
    /**
     * 主键id
     */
    @ApiModelProperty(value = "主键id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 日志类型
     */
    @ApiModelProperty(value = "日志类型")
    private String type;

    /**
     * 日志标题
     */
    @ApiModelProperty(value = "日志标题")
    private String title;

    /**
     * 用户名称
     */
    @ApiModelProperty(value = "用户名称")
    private String userName;

    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id")
    private String userId;

    /**
     * 登录名
     */
    @ApiModelProperty(value = "用户登录名")
    private String loginName;

    /**
     * 日志ip
     */
    @ApiModelProperty(value = "日志ip")
    private String remoteIp;

    /**
     * 日志链接
     */
    @ApiModelProperty(value = "日志链接")
    private String requestUri;

    /**
     * 方法
     */
    @ApiModelProperty(value = "方法")
    private String method;

    /**
     * 参数
     */
    @ApiModelProperty(value = "参数")
    private String params;

    /**
     * 异常
     */
    @ApiModelProperty(value = "异常")
    private String exception;

    /**
     * 请求用时
     */
    @ApiModelProperty(value = "请求用时")
    private Long time;

    /**
     * 应用id
     */
    @ApiModelProperty(value = "应用id")
    private Integer appId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    private Integer tenantId;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    private String createdBy;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DatePattern.NORM_DATETIME_PATTERN, timezone = "GMT+8")
    private LocalDateTime createdAt;

}